package com.kingsoft.dc.khaos.module.spark.preprocess.specific.quality

import com.kingsoft.dc.khaos.module.spark.preprocess.transform.TransformStrategy
import org.apache.spark.sql.{DataFrame, Dataset, Row, SparkSession}

/**
  * 非空检核算子
  *
  *
  */
class NotEmptyCheck extends TransformStrategy with Serializable{
  def analysisData(dataFrame: DataFrame, field: String): DataFrame = {
    val df: DataFrame = dataFrame
    val dataframe: Dataset[Row] = df.filter(row => row.getAs(field) == null || row.getAs(field) == "")
    dataframe
  }
}
